<template>
  <div class="jsbgrxx">
    <p class="top">
      <span style="font-weight: 700; font-size: 16px; color: #000">{{ info.residentName }}</span>
      <span style="display: inline-block; margin: 0 20px"
        >证件号：{{ info.idNo }}</span
      >
      <span>填表人：{{ info.createUserId }}</span>
    </p>
    <div class="box">
      <span>监护人姓名：</span>
      <el-input
        placeholder="请输入"
        v-model="info.guardian"
        style="width: 300px"
        size="small"
      >
      </el-input>
      <div style="margin-top: 15px; color: #f19332"></div>
    </div>
    <div class="box">
      <span>与患者关系：</span>
      <el-input
        placeholder="请输入"
        v-model="info.relationship"
        style="width: 300px"
        size="small"
      >
      </el-input>
      <div style="margin-top: 15px; color: #f19332"></div>
    </div>
    <div class="box">
      <span>监护人住址：</span>
      <el-input
        placeholder="请输入"
        v-model="info.address"
        style="width: 300px"
        size="small"
      >
      </el-input>
      <div style="margin-top: 15px; color: #f19332"></div>
    </div>
    <div class="box">
      <span>监护人电话：</span>
      <el-input
        placeholder="请输入"
        v-model="info.tel"
        style="width: 300px"
        size="small"
      >
      </el-input>
      <div style="margin-top: 15px; color: #f19332"></div>
    </div>
    <div class="box">
      <span>辖区村(居)委会联系人、电话：</span>
      <el-input
        placeholder="请输入"
        v-model="info.areaDebtorTel"
        style="width: 300px"
        size="small"
      >
      </el-input>
      <div style="margin-top: 15px; color: #f19332"></div>
    </div>
    <div class="box">
      <span>户别：</span>
      <el-radio-group v-model="info.households">
        <el-radio label="1">城镇</el-radio>
        <el-radio label="2">农村</el-radio>
      </el-radio-group>
    </div>
    <div class="box">
      <span>就业情况：</span>
      <el-radio-group v-model="info.employment">
        <el-radio label="1">在岗工人</el-radio>
        <el-radio label="2">在岗管理者</el-radio>
        <el-radio label="3">农民</el-radio>
        <el-radio label="4">下岗或无业</el-radio>
        <el-radio label="5">在校学生</el-radio>
        <el-radio label="6">退休</el-radio>
        <el-radio label="7">专业技术人员</el-radio>
        <el-radio label="8">其他</el-radio>
        <el-radio label="9">不详</el-radio>
      </el-radio-group>
    </div>
    <div class="box">
      <span>知情同意：</span>
      <el-radio-group v-model="info.informed">
        <el-radio label="1">不同意参加管理</el-radio>
        <el-radio label="2">同意参加管理</el-radio>
      </el-radio-group>
    </div>
    <div class="box">
      <span>签字：</span>
      <el-button
        icon="el-icon-upload2"
        type="primary"
        style="background-color: #fff; color: rgb(46, 160, 254)"
        size="small"
        plain
        >签字照片</el-button
      >
      <div>
        <img
          style="width: 100px"
          src="http://8.218.107.5:9992/media/base/zhengjian/qrcode/16863931874Q68253F.png"
          alt=""
        />
        <img
          style="width: 100px; margin-left: 20px"
          src="http://8.218.107.5:9992/media/base/zhengjian/qrcode/16863931874Q68253F.png"
          alt=""
        />
      </div>
    </div>
    <div class="box">
      <span>签字时间：</span>
      <el-date-picker
        v-model="info.informedSignDate"
        align="right"
        type="date"
        placeholder="选择签字时间"
        :picker-options="pickerOptions"
        size="small"
      >
      </el-date-picker>
    </div>
    <div class="box">
      <span>初次发病时间：</span>
      <el-date-picker
        v-model="info.sickTime"
        align="right"
        type="date"
        placeholder="选择初次发病时间"
        :picker-options="pickerOptions"
        size="small"
      >
      </el-date-picker>
    </div>
    <div class="box">
      <span>既往主要症状：</span>
      <el-checkbox-group v-model="info.symptoms">
        <el-checkbox label="1" >幻觉</el-checkbox>
        <el-checkbox label="2" >交流困难</el-checkbox>
        <el-checkbox label="3">猜疑</el-checkbox>
        <el-checkbox label="4">喜怒无常</el-checkbox>
        <el-checkbox label="5">行为怪异</el-checkbox>
        <el-checkbox label="6">兴奋话多</el-checkbox>
        <el-checkbox label="7">伤人毁物</el-checkbox>
        <el-checkbox label="8">悲观厌世</el-checkbox>
        <el-checkbox label="9">无故外走</el-checkbox>
        <el-checkbox label="10">自语自笑</el-checkbox>
        <el-checkbox label="11">孤僻懒散</el-checkbox>
        <el-checkbox label="12">其他</el-checkbox>
      </el-checkbox-group>
    </div>
    <div class="box">
      <span>既往关锁情况：</span>
      <el-radio-group v-model="info.shutCase">
        <el-radio label="1">无关锁</el-radio>
        <el-radio label="2">关锁</el-radio>
        <el-radio label="3">关锁已解除</el-radio>
      </el-radio-group>
    </div>
    <p style="font-weight: 900; font-size: 20px; color: #000">既往治疗情况</p>
    <div class="box">
      <span>门诊：</span>
      <el-radio-group v-model="info.outpatient">
        <el-radio label="1">未治</el-radio>
        <el-radio label="2">间断门诊治疗</el-radio>
        <el-radio label="3">连续门诊治疗</el-radio>
      </el-radio-group>
    </div>
    <div class="box">
      <span
        >住院 <br />
        曾住精神专科医院/综合医院精神专科：</span
      >
      <el-input
        placeholder="请输入"
        v-model="info.hospitalization"
        style="width: 300px"
        size="small"
      >
        <template slot="append">次</template>
      </el-input>
    </div>
    <p style="font-weight: 900; font-size: 20px; color: #000">目前诊断情况</p>
    <div class="box">
      <span>诊断</span>
      <el-input
        placeholder="请输入"
        v-model="info.diagnosis"
        style="width: 300px"
        size="small"
      >
        <!-- <template slot="append">次</template> -->
      </el-input>
    </div>
    <div class="box">
      <span>确诊医院</span>
      <el-input
        placeholder="请输入"
        v-model="info.proveHospital"
        style="width: 300px"
        size="small"
      >
        <!-- <template slot="append">次</template> -->
      </el-input>
    </div>
    <div class="box">
      <span>确诊日期：</span>
      <el-date-picker
        v-model="info.proveDate"
        align="right"
        type="date"
        placeholder="选择确诊日期"
        :picker-options="pickerOptions"
        size="small"
      >
      </el-date-picker>
    </div>
    <div class="box">
      <span>最近一次治疗效果：</span>
      <el-radio-group v-model="info.effect">
        <el-radio label="1">临床痊愈</el-radio>
        <el-radio label="2">好转</el-radio>
        <el-radio label="3">无变化</el-radio>
        <el-radio label="4">加重</el-radio>
      </el-radio-group>
    </div>
    <div class="box">
      <span>危险行为：</span>
      <el-checkbox-group v-model="info.dangerousAct">
        <el-checkbox label="1">轻度滋事</el-checkbox>
        <el-input
          placeholder="请输入"
          v-model="info.dangerousActContent1"
          style="width: 200px"
          size="small"
        >
          <template slot="append">次</template>
        </el-input>
        <el-checkbox label="2">肇事</el-checkbox>
        <el-input
          placeholder="请输入"
          v-model="info.dangerousActContent2"
          style="width: 200px"
          size="small"
        >
          <template slot="append">次</template>
        </el-input> <br>
        <el-checkbox label="3" >肇祸</el-checkbox>
        <el-input
          placeholder="请输入"
          v-model="info.dangerousActContent3"
          style="width: 200px"
          size="small"
        >
          <template slot="append">次</template>
        </el-input>
        <el-checkbox label="4">其他危害行为</el-checkbox>
        <el-input
          placeholder="请输入"
          v-model="info.dangerousActContent4"
          style="width: 200px"
          size="small"
        >
          <template slot="append">次</template>
        </el-input> <br>
        <el-checkbox label="5">自伤</el-checkbox>
        <el-input
          placeholder="请输入"
          v-model="info.dangerousActContent5"
          style="width: 200px"
          size="small"
        >
          <template slot="append">次</template>
        </el-input>
        <el-checkbox label="6">自杀未遂</el-checkbox>
        <el-input
          placeholder="请输入"
          v-model="info.dangerousActContent6"
          style="width: 200px"
          size="small"
        >
          <template slot="append">次</template>
        </el-input><br>
        <el-checkbox label="7" >无</el-checkbox>
      </el-checkbox-group>
    </div>
    <div class="box">
      <span>经济状况：</span>
      <el-radio-group v-model="info.economicSituation">
        <el-radio label="1">贫困，在当地贫困线标准以下</el-radio>
        <el-radio label="2">非贫困</el-radio>
      </el-radio-group>
    </div>
    <div class="box">
      <span>专科医生的意见(如果有请记录)：</span>
      <el-input
        placeholder="请输入"
        v-model="info.opinion"
        style="width: 300px"
        size="small"
      >
        <!-- <template slot="append">次</template> -->
      </el-input>
    </div>
    <div class="box">
      <span>医生签字：</span>
      <!-- <el-select
        filterable
        placeholder="请选择"
        size="small"
        style="width: 200px"
        v-model="info.unitName"
      >
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select>
      <el-select
        filterable
        placeholder="请选择"
        size="small"
        style="width: 200px; margin-left: 20px"
        v-model="info.executorName"
      >
        <el-option
          v-for="item in options"
          :key="item.value"
          :label="item.label"
          :value="item.value"
        >
        </el-option>
      </el-select> -->
      <el-input
        placeholder=""
        v-model="info.executorName"
        style="width: 220px"
        size="small"
      >
        <!-- <template slot="append">℃</template> -->
      </el-input>
    </div>
    <div class="box">
      <span>随访照片：</span>
      <el-button
        icon="el-icon-upload2"
        type="primary"
        style="background-color: #fff; color: rgb(46, 160, 254)"
        size="small"
        plain
        >本地上传文件</el-button
      >
      <el-button
        icon="el-icon-picture-outline"
        type="primary"
        style="background-color: #fff; color: rgb(46, 160, 254)"
        size="small"
        plain
        >加载手机图片</el-button
      >
      <p style="margin-top: 10px">
        扫描二维码，在手机端点击"上传"图片，在手机端上传后，点击上方"加载手机照片"按钮，即可同步到电脑端
      </p>
      <div>
        <img
          style="width: 100px"
          src="http://8.218.107.5:9992/media/base/zhengjian/qrcode/16863931874Q68253F.png"
          alt=""
        />
        <img
          style="width: 100px; margin-left: 20px"
          src="http://8.218.107.5:9992/media/base/zhengjian/qrcode/16863931874Q68253F.png"
          alt=""
        />
      </div>
    </div>
  </div>
</template>
      
      <script>
export default {
  data() {
    return {
      info: {
        hospitalId: "3015",
        idNo: localStorage.getItem('idCard'),
        residentName: "测试患者",
        symptoms:[],
        dangerousAct:[]
      },
      options: [
        {
          value: "测试",
          label: "测试",
        },
      ],
      pickerOptions: {
        
        shortcuts: [
          {
            text: "今天",
            onClick(picker) {
              picker.$emit("pick", new Date());
            },
          },
        ],
      },
      value2: "",
    };
  },
  methods: {
    btn_ok() {
      var url = this.info.id
        ? "/mentalDiseaseInfo/modify"
        : "/mentalDiseaseInfo/add";
      this.info.symptoms = this.info.symptoms.toString();
      this.info.dangerousAct = this.info.dangerousAct.toString();
      var date = new Date();
      this.info.id
        ? (this.info.updatetime = date)
        : (this.info.createtime = date);
      this.$post(url, this.info).then((res) => {
        if (res.code == 400) {
          this.$message({
            message: res.message,
            type: "error",
          });
          return;
        }
        this.$message({
          message: "操作成功",
          type: "success",
        });
      });
    },
    getInfo(item) {
      this.isLoading = true;
      this.info = item;
      this.isLoading = false;
    },
    clear_info() {
      this.info = {
        hospitalId: "3015",
        idNo: localStorage.getItem('idCard'),
        residentName: "测试患者",
        symptoms:[],
        dangerousAct:[]
      };
    },
  },
};
</script>
      
      <style scoped lang="scss">
.jsbgrxx {
  .top {
    padding: 10px 20px;
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
  }
  .tab1 {
    tr {
      width: 100%;
      th {
        text-align: center;
        color: #000;
        background-color: rgb(250, 250, 250);
      }
      td {
        padding: 10px;
      }
    }
  }
  .box {
    padding: 10px 250px;
    background-color: rgb(250, 250, 250);
    margin: 10px 0;
  }
}
.table_rd_pd {
  th,
  td {
    padding: 5px 10px;
  }
}
</style>